package com.navinfo.platform.bigdata.util;

/**
 * 对象转成按照_分割的字符串
 */
public class EntityConvert {
    public static final String SPLIT = "_";

    public static String convert(Object ... data){
        if(data == null){
            return null;
        }
        StringBuilder content = new StringBuilder("");
        for(Object o : data){
            content.append(o).append(SPLIT);
        }
        return content.substring(0,content.length() - 1);
    }

    public static String[] revert(String data){
        String[] result = null;

        if(null!=data && data.length()>0  ){
            result = data.split(SPLIT);
        }

        return result;
    }

}
